home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / SECURITY / MNGLR140 / BUGS.TXT < prev    next >
Text File  |  1996-05-01  |  4KB  |  137 lines

  1. Known bugs
  2. ~~~~~~~~~~
  3. * Mangler is not rock solid. Your file should at least pass the Borland
  4.   compiler, before you have a chance that mangler doesn't choke on it.
  5.  
  6.   There are files which I know which broke mangler although I have not
  7.   got that files in hand so I could not fix mangler. You have a 0.8
  8.   probability that mangler mangles your file. Please report errors or
  9.   send me files that mangler does not handle.
  10.  
  11.  
  12. * When using externals like
  13.     {$L InitCrt.obj}
  14.     {$F+}
  15.     Procedure ReInitCrt;external;
  16.   and InitCrt.obj references variables in a unit, you can mangle but
  17.   not compile this unit because Mangler does not know that the .obj
  18.   references variables or procedures in the unit and that it therefore
  19.   should leave them untouched.
  20.   The chance that mangler ever will be modified for this circumstances
  21.   is nil.
  22.   Fix: if possible turn the .obj to assembler and instead of making
  23.   an external routine, make a basm routine.
  24.  
  25.  
  26. * A real Turbo Pascal parser suffers from the fact that it has to
  27.   understand/read compiler directives. Mangler does not do this,
  28.   obviously, else you would have to specify the directives to use
  29.   for every combination of directives. But simply skipping directives
  30.   introduces sometimes strange behaviour. Here a few examples:
  31.  
  32.   The following code will not compile:
  33.  
  34.     procedure dv_TObject.Int15_p0_r0(axValue : word);
  35.     {$IFNDEF DPMI} assembler; {$ENDIF}
  36.     {$IFDEF DPMI}
  37.     begin
  38.       {* do some stuff *}
  39.     end;
  40.     {$ELSE}
  41.     asm
  42.       {* do some asm stuff *}
  43.     end;
  44.     {$ENDIF}
  45.  
  46.   Rewriting this to:
  47.  
  48.     {$IFDEF DPMI}
  49.     procedure dv_TObject.Int15_p0_r0(axValue : word);
  50.     begin
  51.       {* do some stuff *}
  52.     end;
  53.     {$ELSE}
  54.     procedure dv_TObject.Int15_p0_r0(axValue : word);  assembler;
  55.     asm
  56.       {* do some asm stuff *}
  57.     end;
  58.     {$ENDIF}
  59.  
  60.   will make it compile correctly.
  61.  
  62.   Thefollowing code cannot be mangled too:
  63.     {$IFDEF VER60}
  64.     procedure Demo(s : string);
  65.     {$ENDIF}
  66.     {$IFDEF VER70}
  67.     procedure Demo(w : word);
  68.     {$ENDIF}
  69.  
  70.   Again the same variant as the previous two cannot be mangled:
  71.  
  72.     {$IFOPT N+}
  73.     Function FormatF(const Mask : TbxMaskStr;
  74.                            Flt  : Double;
  75.                            DP   : Integer): String;
  76.     {$ELSE}
  77.     Function FormatF(const Mask : TbxMaskStr;
  78.                            Flt  : Real;
  79.                            DP   : Integer): String;
  80.     {$ENDIF}
  81.  
  82.   Fix as the first variant.
  83.  
  84.  
  85. * $I directives are currently ignored. All directives are still included
  86.   in the mangled file but include files are not mangled yet. I want to
  87.   add this feature when mangler is starting to stabelize.
  88.  
  89.  
  90. * not all source code can be mangled correctly. Take the following code
  91.   as an example:
  92.  
  93.     implementation
  94.     uses A;
  95.  
  96.     type
  97.       b = object(parent)     {* object parent is defined in unit A *}
  98.         procedure Demo;
  99.       end;
  100.     var
  101.       a : integer;
  102.  
  103.  
  104.     procedure b.demo;
  105.     begin
  106.       a := 10;
  107.     end;
  108.  
  109.   If object parent contains an attribute a, this file will be mangled
  110.   incorrectly because Mangler does not know that a was defined in
  111.   parent. Such pitfalls only applies to objects.
  112.   A 100% stable mangler therefore has to be able to read .TPU files. Maybe
  113.   I add this to some later version.
  114.  
  115.  
  116.  
  117. Unknown bugs
  118. ~~~~~~~~~~~~
  119. Lots of bugs sit undetected in Mangler. Excuse me for that, but writing
  120. a Mangler is an awful lot like writing a compiler. A real mangler has to
  121. do an entire scanning/parsing/semantic analysis pass to be robust. This
  122. mangler is just a plain hack, to make it work. Therefore this source code
  123. should not be taken as a learning example, or be taken for my ordinary
  124. style of programming :-)
  125.  
  126.  
  127. Would anybody be so kind to report any error to me? If you send a bug report
  128. include the source that failed to be mangled correctly with the message
  129. mangler gave.
  130.  
  131. Send bugs to "Berend de Boer" at:
  132.  
  133.   CompuServe: 100120,3121
  134.   email: 100120.3121@compuserve.com 
  135.   Fidonet: 2:281/527.23
  136.   fax: +31 (0)418-562593
  137.